package com.scott.ch070;

import redis.clients.jedis.Jedis;

/**
 * @author 黄后林
 * @version 1.0
 * @note  有序集合
 * @date 2022-03-25 14:45:01
 */
public class RedisZset {

    public static void main(String[] args) {

        Jedis jedis = new Jedis("192.168.88.129", 6379);
        jedis.zadd("scores",100,"hy");
        jedis.zadd("scores",80,"db");
        jedis.zadd("scores",90,"scott");

        //会根据评分从小到大排序

        System.out.println(jedis.zrange("scores",0,-1));

        jedis.close();
    }
}
